<div class="masonry">
  <div class="item"></div>
  <!-- more items-->
</div>

<style>
  .masonry {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr; /* 分为3行*/
    grid-template-columns: 1fr 1fr 1fr; /* 分为3列*/
    column-gap: 5px; /* 列间距5px*/
  }
</style>
